package hsintiao.com.xintiaoAPP.config;/*
package yft.com.Springbootdemo.config;

import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.LinkedHashMap;
import java.util.Map;

*/
/**
 * @author WEI
 * @version 1.0
 * @date 2020/7/12 14:22
 *//*

@Configuration
public class ShiroConfig {

    @Bean
    public ShiroFilterFactoryBean getShiroFilterFactoryBean(DefaultWebSecurityManager securityManager){
        ShiroFilterFactoryBean filterFactoryBean = new ShiroFilterFactoryBean();
        //设置安全管理器
        filterFactoryBean.setSecurityManager(securityManager);
        */
/**
         * 添加内置的shiro过滤器
         * anon:无需认证就可以访问
         * authc:必须认证了才能访问
         * user:必须拥有记住我功能才能使用
         * perms:拥有对某个资源的权限才能访问
         * role:拥有某个角色权限才能访问
         *//*

        Map<String,String> map = new LinkedHashMap<>();

//        map.put("/**","authc");
//        map.put("/login","anon");
//        map.put("/user/*","authc");
//        map.put("/staff/*","authc");
//        map.put("/user/list","perms[user:list]");
        filterFactoryBean.setFilterChainDefinitionMap(map);

        //没有权限时请求的url
        filterFactoryBean.setLoginUrl("/toLogin");

        //未经授权时请求的url
        filterFactoryBean.setUnauthorizedUrl("/unAuthorized");
        return filterFactoryBean;
    }

    @Bean
    public DefaultWebSecurityManager getDefaultWebSecurityManager( CustomRealm customRealm){
        DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
        //关联Realm
        securityManager.setRealm(customRealm);
        return securityManager;
    }

    //创建一个Realm对象
    @Bean
    public CustomRealm getCustomRealm(){
        return new CustomRealm();
    }







}
*/
